package com.kt.dion.golf.data;

import java.util.ArrayList;

import com.kt.dion.golf.util.ResourceManager;

public class HoleDetailData extends Data
{
	public static final String TYPE_HOLE = "0";
	public static final String TYPE_GREEN = "1";
	public static final String TYPE_TEXT = "2";

	private ArrayList arrHoleData = new ArrayList();

	public void addHoleData(HoleData holeData)
	{
		arrHoleData.add(holeData);
	}

	public HoleData getHoleData(int i)
	{
		return (HoleData) arrHoleData.get(i);
	}

	public int getDataSize()
	{
		return this.arrHoleData.size();
	}

	private String name;
	private String par;
	private String ya;

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getPar()
	{
		return par;
	}

	public void setPar(String par)
	{
		this.par = par;
	}

	public String getYa()
	{
		return ya;
	}

	public void setYa(String ya)
	{
		this.ya = ya;
	}

	public class HoleData extends Data
	{
		private String type;
		private String imageName;
		private String content;

		public String getType()
		{
			return type;
		}

		public void setType(String type)
		{
			this.type = type;
		}

		public String getImageName()
		{
			return imageName;
		}

		public void setImageName(String imageName)
		{
			this.imageName = imageName;
		}

		public String getContent()
		{
			return content;
		}

		public void setContent(String content)
		{
			this.content = content;
		}

		public void dispose(boolean isDisposeOfPage)
		{
			ResourceManager.getInstance().removeImage(imageName);
			imageName = null;
		}

		public String toString()
		{
			return null;
		}
	}

	public void dispose(boolean isDisposeOfPage)
	{
		for (int i = 0; i < getDataSize(); i++)
			getHoleData(i).dispose(false);
	}

	public String toString()
	{
		return null;
	}
}
